#define _CRT_SECURE_NO_WARNINGS 1
int removeElement(int* nums, int numsSize, int val) {
    int tmp1 = 0;
    int tmp2 = 0;
    while (tmp1 < numsSize)
    {
        if (nums[tmp1] != val)
        {
            nums[tmp2++] = nums[tmp1++];
        }
        else
        {
            tmp1++;
        }
    }
    return tmp2;
}